package cn.cjxy.demo;


import cn.cjxy.domain.Account;
import cn.cjxy.service.AccountService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
@RunWith(SpringRunner.class)
@ContextConfiguration(locations = "classpath:application.xml")
public class Demo02 {


    @Autowired
    private AccountService accountService;

    @Test
    public void test1() throws Exception{
        List<Account> accountList = accountService.findAll();

        for (Account account : accountList) {
            System.out.println(account);
        }
    }

    @Test
    public void test2() throws Exception{
        accountService.transfer(1,2,100.0D);
    }
}